package com.example.productdataserviceprovider.service.city;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class TestCity {
    public void testDouble(){
        BufferedReader reader=null;
        try {
            reader=new BufferedReader(new FileReader("D:/jd/resultData2.txt"));
            String line=null;
            Map<String,String> datas=new HashMap<>();
            while((line=reader.readLine())!=null){
                String[] ds=line.split(",");
                datas.put(ds[0],"");
            }
            System.out.println(datas.size());
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            if(reader!=null){
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) {
        String dir="D:\\library\\test";
        File dirFile=new File(dir);
        File[] files=dirFile.listFiles();
        for(File file:files){
            if(file.length()==0)file.delete();
        }
    }
}
